#pragma warning(disable:4996)
#pragma warning(disable:6031)
#pragma warning(disable:6011)

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define MAXK 1e7

namespace Y190619_polynomial {
int main();
double f(int n, double a[], double x)
{
	int i;
	double p = a[n];
	for (i = n; i > 0; i--)
		p = a[i - 1] + x * p;
	return p;
}

int main()
{
	int n = 3;
	double a[] = { 1,2,3,4 };
	double value = 0;
	clock_t start, stop;
	start = clock();
	for (int i = 0; i < MAXK; i++)
		value = f(3, a, 3);
	stop = clock();
	double duration = ((double)(stop - start)) / CLK_TCK;
	printf("%.3f, %.3f", duration, value);
	return 0;
}
}

int main_Y190619_polynomial()
{
	return Y190619_polynomial::main();
}